<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let arr = ["关羽", "张飞", "马超", "黄忠", "赵云"];
      for (let i = 1; i <= 3; i++) {
        let hero = prompt("请输入新的武将:");
        arr.push(hero);
      }
      //   arr.shift();删除数组中的第一个数据
      //   arr.pop();删除数组中的最后一个数据
    //   从索引0开始删除两个数据
      arr.splice(0, 2);
      //
      for (let i = 0; i < arr.length; i++) {
        console.log(arr[i]);
      }
    </script>
  </body>
</html>
